package com.jxwifi.cloud.quickcleanserver.adapter;

import android.graphics.Color;
import android.support.annotation.LayoutRes;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.jxwifi.cloud.quickcleanserver.R;
import com.jxwifi.cloud.quickcleanserver.bean.RecordsBean;

/**
 * Created by Administrator on 2019/5/14.
 */

public class PriceDetailedListAdapter extends BaseQuickAdapter<RecordsBean, BaseViewHolder> {


    public PriceDetailedListAdapter(@LayoutRes int layoutResId){
        super(layoutResId, null);
    }

    @Override
    protected void convert(BaseViewHolder helper, RecordsBean item) {
        helper.setText(R.id.tv_my_balance_name_item,item.getDescription());
        if ("IN".equals(item.getType())){
            helper.setText(R.id.tv_my_balance_time_price,"+"+item.getRealAmount()+"元");
            helper.setTextColor(R.id.tv_my_balance_time_price,Color.parseColor("#EF6464"));
        }else if ("OUT".equals(item.getType())){
            helper.setText(R.id.tv_my_balance_time_price,"-"+item.getRealAmount()+"元");
            helper.setTextColor(R.id.tv_my_balance_time_price,Color.parseColor("#333333"));
        }
        helper.setText(R.id.tv_my_balance_time_item,item.getCreateTime());
    }

}
